﻿using Adnc.Infra.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace WYT.Usr.Repository.Entities
{
    /// <summary>
    /// 用户返佣记录
    /// </summary>
    [Table("usr_userCommission"), Comment("用户返佣记录"), Index(nameof(UserId))]
    public class UserCommission : EfEntity
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        [Comment("用户ID")]
        public long UserId { get; set; }

        /// <summary>
        /// 用户当时等级
        /// </summary>
        [Comment("用户当时等级")]
        public int CurrentGrade { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        [Comment("订单ID")]
        public long OrderId { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        [Comment("金额"),Column(TypeName = "decimal(18,2)")]
        public decimal Amount { get; set; }

        /// <summary>
        /// 类型 1：差价返佣 2：出库返本金 3：第三方商品返佣
        /// </summary>
        [Comment("类型 1：差价返佣 2：出库返本金 3：第三方商品返佣")]
        public int Type { get; set; }

        /// <summary>
        /// 状态 -1：取消 0：未完成 1：已完成
        /// </summary>
        [Comment("状态 -1：取消 0：未完成 1：已完成")]
        public int State { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Comment("创建时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 到账时间
        /// </summary>
        [Comment("到账时间")]
        public DateTime? ArrivalTime { get; set; }
    }
}
